Scenario #2012: Create External Debitor for Partner

UseCase Create External Debitor For Partner => Debitor: D-3101002 - Test AG - external debitor

Properties

Required

Given

name value
partnerPersonTradeName Test AG
billingContactCaption Billing GmbH - billing department
billingContactEmailAddress billing@test-ag.example.org
debitorNumberSuffix 02
billable true
vatId VAT123456
vatCountryCode DE
vatBusiness true
vatReverseCharge false
defaultPrefix tsy

Person: Test AG

HTTP GET "/api/hs/office/persons?name=Test+AG" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "efe3662a-02d9-4fa9-a4f0-29dfd893fd78", // partnerPersonUuid
  "personType" : "LEGAL_PERSON",
  "tradeName" : "Test AG",
  "salutation" : null,
  "title" : null,
  "givenName" : null,
  "familyName" : null
} ]

In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one.

BankAccount: Billing GmbH - refund bank account

HTTP POST "/api/hs/office/bankaccounts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "holder" : "Billing GmbH - refund bank account",
  "iban" : "DE02120300000000202051",
  "bic" : "BYLADEM1001"
}
EOF
=> status: 201 CREATED 2ffacb2b-5466-483d-a9af-2c1b66de224b

Contact: Billing GmbH - Test AG billing

HTTP POST "/api/hs/office/contacts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "caption" : "Billing GmbH, billing for Test AG",
  "emailAddresses" : {
    "main" : "test-ag@billing-GmbH.example.com"
  }
}
EOF
=> status: 201 CREATED 71c7800a-76f2-4372-b69e-f8d09d3c521f

Create Debitor: D-3101002 - Test AG - external debitor

HTTP POST "/api/hs/office/debitors" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "debitorRel" : {
    "anchor.uuid" : "efe3662a-02d9-4fa9-a4f0-29dfd893fd78", // Person: Test AG
    "holder.uuid" : "b3d2c25c-fde0-4a91-bbb4-a24669a35832", // Person: Billing GmbH
    "contact.uuid" : "71c7800a-76f2-4372-b69e-f8d09d3c521f" // Contact: Billing GmbH - Test AG billing
  },
  "debitorNumberSuffix" : "02",
  "billable" : true,
  "vatId" : "VAT123456",
  "vatCountryCode" : "DE",
  "vatBusiness" : true,
  "vatReverseCharge" : false,
  "refundBankAccount.uuid" : "2ffacb2b-5466-483d-a9af-2c1b66de224b", // BankAccount: Billing GmbH - refund bank account
  "defaultPrefix" : "tsy"
}
EOF
=> status: 201 CREATED 0b5e4701-c589-4437-b899-2fd214458d76

generated on 2026-08-10 04:42:24 for branch HEAD